/**
 **@author:		周羽
 **@date:		2017-03-30
 **@brief:		打开消息队列，并进行相应的操作
 **/
#include "pthread_uart_cmd.h"
#include "get_queue_id.h"

void pthread_uart_cmd(void)
{
	get_queue_id();

	if(msgrcv(msgid, (void *)&msg, sizeof(struct msg_t)-sizeof(long)) < 0)
	{
		perror("fail to msgrcv");
		exit(-1);
	}

	if(-1 == write(dev_uart_fd, msg.2L, sizeof(long)))
	{
		perror("write error");
		exit(-1);
	}


}
